/** 
 * 
 */

/**
 * @author 
 * Yannic Remmet			196983
 * Tobias Trabelsi			197112
 * Anna-Katharina Wickert	197122
 */
public class Test {
	public static void main(String[] args){
	//	try {
			TreeNode<Integer> root = new TreeNode<Integer>(4);
			SearchTree<Integer> test = new SearchTree<Integer>(root);

			//System.out.println("test.insert(null)  (false) : " +  test.insert(null));
			System.out.println("test.insert(2) (true): " + test.insert(2));
			System.out.println("test.insert(6) (true): " + test.insert(6));
			System.out.println("test.insert(8) (true): " + test.insert(8));
			System.out.println("test.insert(9); (true): " + test.insert(9));
			System.out.println("test.insert(7); (true): " + test.insert(7));
			System.out.println("test.insert(5); (true): " + 	test.insert(5));
			System.out.println("test.insert(3); (true): " + test.insert(3));
			System.out.println("test.insert(1); (true): " + test.insert(1)); 
		
			  
			  
			
			System.out.println("postOrder() ( 9 7 8 5 6 3 1 2 4  ) "+ test.postOrder());   
			System.out.println("leverOder (4 6 2 8 5 3 1 9 7 ) " + test.levelOrder());
			System.out.println("preOrder (4 6 8 9 7 5 2 3 1 ) " + test.preOrder());
			
			System.out.println("Level of 3 (2): " +test.level(3));
			System.out.println("Level of 15 (4): " + test.level(15));
			
			System.out.println("Find Parent of 9 (8) " + test.findParent(9));
			System.out.println("Find Parent of 5 (6) " + test.findParent(5));
			System.out.println("Find Parent of 1 (2) " + test.findParent(1));
			System.out.println("Find Parent of 11 (null) " + test.findParent(11));
			
			System.out.println("Delete (5) "); test.delete(5);
			System.out.println("postOrder() ( 9 7 8 6 3 1 2 4 ) " + test.postOrder());
			System.out.println("Delte (6) " ); test.delete(6);
			System.out.println("porstOrder(9 7 8 3 1 2 4) (9 7 8 3 1 2 4) " + test.postOrder());
			System.out.println("Delete (4) "); test.delete(4);
			System.out.println("postOrder() (9 7 8 1 2 3)" + test.postOrder());
			System.out.println("Delete (7) "); test.delete(7);
			System.out.println("postOrder() (9 8 1 2 3)" + test.postOrder());
			System.out.println("Delete (8) "); test.delete(8);
			System.out.println("postOrder() (9 1 2 3)" + test.postOrder());
			System.out.println("Delete (9) "); test.delete(9);
			System.out.println("postOrder() (1 2 3)" + test.postOrder());
			System.out.println("Delete (2) "); test.delete(2);
			System.out.println("postOrder() (1 3)" + test.postOrder());
			System.out.println("Delete (1) "); test.delete(1);
			System.out.println("postOrder() (3 )" + test.postOrder());
			System.out.println("Delete (3) "); test.delete(3);
			System.out.println("postOrder() (null) " + test.postOrder());
			
	/*	}
		catch (NullPointerException a) {
			System.err.println("Message: "  + a.getMessage() + " Cause: " + a.getCause() + a.getStackTrace()+" NullPointer ");
		}*/
	}
}
